package com.rongke.enums;

/**
 * Created by mifan on 2017/4/21.
 */
public enum AreaTypeEnum {
    XC(1,"下城区"),
    SC(2,"上城区"),
    XS(3,"萧山区"),
    XH(4,"西湖区"),
    JG(5,"江干区"),
    GS(6,"拱墅区"),
    FY(7,"富阳区"),
    BJ(8,"滨江区"),
    YH(9,"余杭区"),
    LA(10,"临安"),
    JD(11,"建德"),
    TL(12,"桐庐"),
    CA(13,"淳安"),
    HL(14,"海宁"),
    NULLDATA(15,"");

    AreaTypeEnum(Integer type, String typeName) {
        this.type = type;
        this.typeName = typeName;
    }

    private Integer type;

    private String typeName;

    /**
     * 根据type 获取typeName
     * @param type
     * @return
     */
    public static AreaTypeEnum getTypeNameByType(Integer type) {
        for (AreaTypeEnum typeEnum: values()) {
            if (typeEnum.getType().equals(type)) {
                return typeEnum;
            }
        }
        return NULLDATA;
    }

    public static AreaTypeEnum[] getAllAwards() {
        return values();
    }

    public Integer getType() {
        return type;
    }

    public String getTypeName() {
        return typeName;
    }
}
